/**
 * Copyright 2010 Andreas Keefer
 *
 * This file is part of jHashMe.
 *
 * jHashMe is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * jHashMe is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with jHashMe.  If not, see <http://www.gnu.org/licenses/>.
 */

package de.jhashme.hash.service;

import java.io.File;
import java.io.IOException;
import java.util.Set;

/**
 * This Service provides the Facade for the HashServiceProviders.
 */
public interface HashService {

    /**
     * Calculate the Hash value of a File
     *
     * @param hashAlgorithm the HashAlgorithm which should be used
     * @param fileToHash    the File, which should be hashed
     * @return the Hash value
     * @throws HashAlgorithmNotFoundException if HashAlgorithm was not found.
     * @throws IOException                    if IO Error occurred (file not found, ...).
     */
    public String hash(HashAlgorithm hashAlgorithm, File fileToHash) throws HashAlgorithmNotFoundException, IOException;

    /**
     * Calculate the Hash value of an Text
     *
     * @param hashAlgorithm the HashAlgorithm which should be used
     * @param textToHash    the Text which should be hashed
     * @return the Hash value
     * @throws HashAlgorithmNotFoundException if HashAlgorithm was not found.
     */
    public String hash(HashAlgorithm hashAlgorithm, String textToHash) throws HashAlgorithmNotFoundException;

    /**
     * Returns a Set of all at the moment available HashAlgorithms.
     *
     * @return all available HashAlgorithms
     */
    public Set<HashAlgorithm> getAvailableHashAlgorithms();
}
